<template>
<div>
  <button @click="getStudent">点击获取学生的信息</button>
  <button @click="getCar">点击获取汽车信息</button>
  </div>
</template>

<script>
import axios from 'axios';
export default {
    name:'App',
    methods:{
      getStudent(){
          axios.get('http://localhost:8080/a/students').then(
            (response)=>{
                console.log(response.data)
            },
            (err)=>{
                console.log(err)
            }
          )
      },
      getCar(){
          axios.get('http://localhost:8080/b/cars').then(
            (response)=>{
              console.log(response.data)
            },
            (err)=>{
              console.log(err);
            }
          )
      }
    }
}
</script>

<style>
button{
  margin-left:10px;
}
</style>